   <?php
   include_once ("$basedir"."/Login/databaseconnection.php");

if(!loggedin())
{
	require_once ("$basedir"."/index.php");
}
 else
   {
$School_Id=$_POST['School_Id'];
$Exam_Name=$_POST['Exam_Name'];
$Year=$_POST['Year'];
$No_Of_Sat_Students=$_POST['No_Of_Sat_Students'];
$No_Of_Passed_Students=$_POST['No_Of_Passed_Students'];
if($School_Id!=""&&$Exam_Name!=""&&$Year!=""&&$No_Of_Sat_Students!=""&&$No_Of_Passed_Students!="")
{
  mysql_query("INSERT INTO exam(School_Id,Exam_Name,Year,No_Of_Sat_Students,No_Of_Passed_Students)VALUES('$School_Id','$Exam_Name','$Year','$No_Of_Sat_Students','$No_Of_Passed_Students')");
   if(mysql_affected_rows()!=0)
  {
$_SESSION['error']="This record is successfully registered!";
  }
if(mysql_affected_rows()==0)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
}
  if($School_Id==""||$Exam_Name==""||$Year==""||$No_Of_Sat_Students==""||$No_Of_Passed_Students=="")
{
$_SESSION['errorin']="Please fill all!";
}
}
 ?>
